home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / emacs.lha / emacs-19.16 / configure < prev    next >
Text File  |  1993-07-06  |  62KB  |  2,308 lines

  1. #!/bin/sh
  2. #### Configuration script for GNU Emacs
  3. #### Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. ### Don't edit this script!
  6. ### This script was automatically generated by the `autoconf' program
  7. ### from the file `./configure.in'.
  8. ### To rebuild it, execute the command
  9. ###    autoconf
  10. ### in the this directory.  You must have autoconf version 1.4 or later.
  11.  
  12. ### This file is part of GNU Emacs.
  13.  
  14. ### GNU Emacs is free software; you can redistribute it and/or modify
  15. ### it under the terms of the GNU General Public License as published by
  16. ### the Free Software Foundation; either version 1, or (at your option)
  17. ### any later version.
  18.  
  19. ### GNU Emacs is distributed in the hope that it will be useful,
  20. ### but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. ### GNU General Public License for more details.
  23.  
  24. ### You should have received a copy of the GNU General Public License
  25. ### along with GNU Emacs; see the file COPYING.  If not, write to
  26. ### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  27.  
  28.  
  29. ### Since Emacs has configuration requirements that autoconf can't
  30. ### meet, this file is an unholy marriage of custom-baked
  31. ### configuration code and autoconf macros.
  32. ###
  33. ### We use the m4 quoting characters [ ] (as established by the
  34. ### autoconf system) to include large sections of raw sewage - Oops, I
  35. ### mean, shell code - in the final configuration script.
  36. ###
  37. ### Usage: configure config_name
  38. ###
  39. ### If configure succeeds, it leaves its status in config.status.
  40. ### If configure fails after disturbing the status quo,
  41. ###     config.status is removed.
  42.  
  43.  
  44. ### Remove any more than one leading "." element from the path name.
  45. ### If we don't remove them, then another "./" will be prepended to
  46. ### the file name each time we use config.status, and the program name
  47. ### will get larger and larger.  This wouldn't be a problem, except
  48. ### that since progname gets recorded in all the Makefiles this script
  49. ### produces, move-if-change thinks they're different when they're
  50. ### not.
  51. ###
  52. ### It would be nice if we could put the ./ in a \( \) group and then
  53. ### apply the * operator to that, so we remove as many leading ./././'s
  54. ### as are present, but some seds (like Ultrix's sed) don't allow you to
  55. ### apply * to a \( \) group.  Bleah.
  56. progname="`echo $0 | sed 's:^\./\./:\./:'`"
  57.  
  58.  
  59. #### Usage messages.
  60.  
  61. short_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...]
  62.  
  63. Set compilation and installation parameters for GNU Emacs, and report.
  64. CONFIGURATION specifies the machine and operating system to build for.
  65. --with-x        Support the X Window System.
  66. --with-x=no        Don't support X.
  67. --x-includes=DIR     Search for X header files in DIR.
  68. --x-libraries=DIR    Search for X libraries in DIR.
  69. --with-gcc        Use GCC to compile Emacs.
  70. --with-gcc=no        Don't use GCC to compile Emacs.
  71. --run-in-place        Use libraries and data files directly out of the 
  72.             source tree.
  73. --srcdir=DIR        Look for source in DIR.
  74. --prefix=DIR        Install files below dir.
  75.  
  76. If successful, ${progname} leaves its status in config.status.  If
  77. unsuccessful after disturbing the status quo, it removes config.status."
  78.  
  79.  
  80. #### Option processing.
  81.  
  82. ### Record all the arguments, so we can save them in config.status.
  83. arguments="$@"
  84.  
  85. ### These values are used to comment and uncomment different values
  86. ### for the path variables in the Makefile, to choose the installed
  87. ### configuration or the run-in-place configuration.
  88. rip_paths='#disabled# '
  89. inst_paths=''
  90.  
  91. ### Establish some default values.
  92. prefix='/usr/local'
  93. exec_prefix='${prefix}'
  94.  
  95. ### Don't use shift -- that destroys the argument list, which autoconf needs
  96. ### to produce config.status.  It turns out that "set - ${arguments}" doesn't
  97. ### work portably.
  98. index=0
  99. while [ $index -lt $# ]; do
  100.   index=`expr $index + 1`
  101.   arg=`eval echo '$'$index`
  102.   case "${arg}" in
  103.  
  104.     ## Anything starting with a hyphen we assume is an option.
  105.     -* )
  106.  
  107.       ## Separate the switch name from the value it's being given.
  108.       case "${arg}" in
  109.         -*=*)
  110.       opt=`echo ${arg} | sed 's:^-*\([^=]*\)=.*$:\1:'`
  111.       val=`echo ${arg} | sed 's:^-*[^=]*=\(.*\)$:\1:'`
  112.       valomitted=no
  113.     ;;
  114.         -*)
  115.           ## If FOO is a boolean argument, --FOO is equivalent to
  116.           ## --FOO=yes.  Otherwise, the value comes from the next
  117.           ## argument - see below.
  118.       opt=`echo ${arg} | sed 's:^-*\(.*\)$:\1:'`
  119.           val="yes"
  120.           valomitted=yes
  121.         ;;
  122.       esac
  123.  
  124.       ## Change `-' in the option name to `_'.
  125.       optname="${opt}"
  126.       opt="`echo ${opt} | tr - _`"
  127.  
  128.       ## Process the option.
  129.       case "${opt}" in
  130.  
  131.         ## Has the user specified which window systems they want to support?
  132.         "with_x" | "with_x11" | "with_x10" )
  133.       ## Make sure the value given was either "yes" or "no".
  134.       case "${val}" in
  135.         y | ye | yes )    val=yes ;;
  136.         n | no )        val=no  ;;
  137.         * )
  138.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  139. Set it to either \`yes' or \`no'."
  140.            echo "${short_usage}") >&2
  141.           exit 1
  142.         ;;
  143.       esac
  144.           eval "${opt}=\"${val}\""
  145.         ;;
  146.  
  147.     ## Has the user specified whether or not they want GCC?
  148.     "with_gcc" | "with_gnu_cc" )
  149.       ## Make sure the value given was either "yes" or "no".
  150.       case "${val}" in
  151.         y | ye | yes )    val=yes ;;
  152.         n | no )        val=no  ;;
  153.         * )
  154.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  155. Set it to either \`yes' or \`no'."
  156.            echo "${short_usage}") >&2
  157.           exit 1
  158.         ;;
  159.       esac
  160.           eval "${opt}=\"${val}\""
  161.         ;;
  162.  
  163.         ## Has the user specified a source directory?
  164.     "srcdir" )
  165.       ## If the value was omitted, get it from the next argument.
  166.       if [ "${valomitted}" = "yes" ]; then
  167.         ## Get the next argument from the argument list, if there is one.
  168.             if [ $index = $# ]; then
  169.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  170.     \`--${optname}=FOO'."
  171.            echo "${short_usage}") >&2
  172.           exit 1
  173.         fi
  174.             index=`expr $index + 1`
  175.             val=`eval echo '$'$index`
  176.       fi
  177.           srcdir="${val}"
  178.     ;;
  179.  
  180.     ## Has the user tried to tell us where the X files are?
  181.     ## I think these are dopey, but no less than three alpha
  182.     ## testers, at large sites, have said they have their X files
  183.     ## installed in odd places.
  184.     "x_includes" )
  185.       ## If the value was omitted, get it from the next argument.
  186.       if [ "${valomitted}" = "yes" ]; then
  187.         ## Get the next argument from the argument list, if there is one.
  188.             if [ $index = $# ]; then
  189.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  190.     \`--${optname}=FOO'."
  191.            echo "${short_usage}") >&2
  192.           exit 1
  193.         fi
  194.             index=`expr $index + 1`
  195.             val=`eval echo '$'$index`
  196.       fi
  197.       x_includes="${val}"
  198.       C_SWITCH_X_SITE="-I\"${x_includes}\""
  199.         ;;
  200.     "x_libraries" )
  201.       ## If the value was omitted, get it from the next argument.
  202.       if [ "${valomitted}" = "yes" ]; then
  203.         ## Get the next argument from the argument list, if there is one.
  204.             if [ $index = $# ]; then
  205.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  206.     \`--${optname}=FOO'."
  207.            echo "${short_usage}") >&2
  208.           exit 1
  209.         fi
  210.             index=`expr $index + 1`
  211.             val=`eval echo '$'$index`
  212.       fi
  213.       x_libraries="${val}"
  214.       LD_SWITCH_X_SITE="-L\"${x_libraries}\""
  215.         ;;
  216.  
  217.     ## Should this use the "development configuration"?
  218.     "run_in_place" )
  219.       rip_paths=''
  220.       inst_paths='#disabled# '
  221.     ;;
  222.  
  223.     ## Has the user specified an installation prefix?
  224.     "prefix" )
  225.       ## If the value was omitted, get it from the next argument.
  226.       if [ "${valomitted}" = "yes" ]; then
  227.         ## Get the next argument from the argument list, if there is one.
  228.             if [ $index = $# ]; then
  229.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  230.     \`--${optname}=FOO'."
  231.            echo "${short_usage}") >&2
  232.           exit 1
  233.         fi
  234.             index=`expr $index + 1`
  235.             val=`eval echo '$'$index`
  236.       fi
  237.       prefix="${val}"
  238.         ;;
  239.  
  240.     ## Has the user specified an installation prefix?
  241.     "exec_prefix" )
  242.       ## If the value was omitted, get it from the next argument.
  243.       if [ "${valomitted}" = "yes" ]; then
  244.         ## Get the next argument from the argument list, if there is one.
  245.             if [ $index = $# ]; then
  246.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  247.     \`--${optname}=FOO'."
  248.            echo "${short_usage}") >&2
  249.           exit 1
  250.         fi
  251.             index=`expr $index + 1`
  252.             val=`eval echo '$'$index`
  253.       fi
  254.       exec_prefix="${val}"
  255.         ;;
  256.  
  257.     ## Verbose flag, tested by autoconf macros.
  258.     "verbose" )
  259.       verbose=yes
  260.     ;;
  261.  
  262.     ## Has the user asked for some help?
  263.     "usage" | "help" )
  264.       echo "${short_usage}" | more
  265.       exit
  266.     ;;
  267.  
  268.         ## We ignore all other options silently.
  269.       esac
  270.     ;;
  271.  
  272.     ## Anything not starting with a hyphen we assume is a
  273.     ## configuration name.
  274.     *)
  275.       configuration=${arg}
  276.     ;;
  277.  
  278.   esac
  279. done
  280.  
  281. if [ "${configuration}" = "" ]; then
  282.   echo '- You did not tell me what kind of host system you want to configure.
  283. - I will attempt to guess the kind of system this is.' 1>&2
  284.   guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
  285.   if configuration=`${guesssys}` ; then
  286.     echo "- Looks like this is a ${configuration}" 1>&2
  287.   else
  288.     echo '- Failed to guess the system type.  You need to tell me.' 1>&2
  289.     echo "${short_usage}" >&2
  290.     exit 1
  291.   fi
  292. fi
  293.  
  294. #### Decide where the source is.
  295. case "${srcdir}" in
  296.  
  297.   ## If it's not specified, see if  `.' or `..' might work.
  298.   "" )
  299.     confdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
  300.     if [ -f $confdir/src/lisp.h -a -f $confdir/lisp/version.el ]; then
  301.       srcdir="${confdir}"
  302.     else
  303.       if [ -f "./src/lisp.h" -a -f "./lisp/version.el" ]; then
  304.         srcdir='.'
  305.       else
  306.         if [ -f "../src/lisp.h" -a -f "../lisp/version.el" ]; then
  307.       srcdir='..'
  308.         else
  309.       (echo "\
  310. ${progname}: Neither the current directory nor its parent seem to
  311. contain the Emacs sources.  If you do not want to build Emacs in its
  312. source tree, you should run \`${progname}' in the directory in which
  313. you wish to build Emacs, using its \`--srcdir' option to say where the
  314. sources may be found."
  315.         echo "${short_usage}") >&2
  316.       exit 1
  317.         fi
  318.       fi
  319.     fi
  320.   ;;
  321.  
  322.   ## Otherwise, check if the directory they specified is okay.
  323.   * )
  324.     if [ ! -d "${srcdir}" -o ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then
  325.       (echo "\
  326. ${progname}: The directory specified with the \`--srcdir' option,
  327. \`${srcdir}', doesn't seem to contain the Emacs sources.  You should
  328. either run the \`${progname}' script at the top of the Emacs source
  329. tree, or use the \`--srcdir' option to specify where the Emacs sources
  330. are."
  331.        echo "${short_usage}") >&2
  332.       exit 1
  333.     fi
  334.   ;;
  335. esac
  336.  
  337. #### Make srcdir absolute, if it isn't already.  It's important to
  338. #### avoid running the path through pwd unnecessary, since pwd can
  339. #### give you automounter prefixes, which can go away.
  340. case "${srcdir}" in
  341.   /* ) ;;
  342.   . )
  343.     ## We may be able to use the $PWD environment variable to make this
  344.     ## absolute.  But sometimes PWD is inaccurate.
  345.     if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; pwd)`" = "`pwd`" ] ; then
  346.       srcdir="$PWD"
  347.     else
  348.       srcdir="`(cd ${srcdir}; pwd)`"
  349.     fi
  350.   ;;
  351.   *  ) srcdir="`(cd ${srcdir}; pwd)`" ;;
  352. esac
  353.  
  354. #### Make sure that the source directory doesn't already have a
  355. #### configured system in it.
  356. if [ `pwd` != `(cd ${srcdir} && pwd)` ] \
  357.    && [ -f "${srcdir}/src/config.h" ] ; then
  358.   (echo "${progname}: the directory tree \`${srcdir}' is being used"
  359.    echo "   as a build directory right now; it has been configured in its own"
  360.    echo "   right.  You can't use srcdir in this situation.") >&2
  361.   exit 1
  362. fi
  363.  
  364. ### Make the necessary directories, if they don't exist.
  365. for dir in ./src ./lib-src ./cpp ./oldXMenu ./etc ; do
  366.   if [ ! -d ${dir} ]; then
  367.     mkdir ${dir}
  368.   fi
  369. done
  370.  
  371. #### Given the configuration name, set machfile and opsysfile to the
  372. #### names of the m/*.h and s/*.h files we should use.
  373.  
  374. ### Canonicalize the configuration name.
  375. echo "Checking the configuration name."
  376. if configuration=`${srcdir}/config.sub "${configuration}"` ; then : ; else
  377.   exit $?
  378. fi
  379.  
  380. ### If you add support for a new configuration, add code to this
  381. ### switch statement to recognize your configuration name and select
  382. ### the appropriate operating system and machine description files.
  383.  
  384. ### You would hope that you could choose an m/*.h file pretty much
  385. ### based on the machine portion of the configuration name, and an s-
  386. ### file based on the operating system portion.  However, it turns out
  387. ### that each m/*.h file is pretty manufacturer-specific - for
  388. ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
  389. ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
  390. ### machines.  So we basically have to have a special case for each
  391. ### configuration name.
  392. ###
  393. ### As far as handling version numbers on operating systems is
  394. ### concerned, make sure things will fail in a fixable way.  If
  395. ### /etc/MACHINES doesn't say anything about version numbers, be
  396. ### prepared to handle anything reasonably.  If version numbers
  397. ### matter, be sure /etc/MACHINES says something about it.
  398. ###
  399. ### Eric Raymond says we should accept strings like "sysvr4" to mean
  400. ### "System V Release 4"; he writes, "The old convention encouraged
  401. ### confusion between `system' and `release' levels'."
  402.  
  403. machine='' opsys='' unported='false'
  404. case "${configuration}" in
  405.  
  406.   ## Alliant machines
  407.   ## Strictly speaking, we need the version of the alliant operating
  408.   ## system to choose the right machine file, but currently the
  409.   ## configuration name doesn't tell us enough to choose the right
  410.   ## one; we need to give alliants their own operating system name to
  411.   ## do this right.  When someone cares, they can help us.
  412.   fx80-alliant-* )
  413.     machine=alliant4 opsys=bsd4-2
  414.   ;;
  415.   i860-alliant-* )
  416.     machine=alliant-2800 opsys=bsd4-3
  417.   ;;
  418.  
  419.   ## Altos 3068
  420.   m68*-altos-sysv* )
  421.     machine=altos opsys=usg5-2
  422.   ;;
  423.     
  424.   ## Amdahl UTS
  425.   580-amdahl-sysv* )
  426.     machine=amdahl opsys=usg5-2-2
  427.   ;;
  428.  
  429.   ## Appallings - I mean, Apollos - running Domain
  430.   m68*-apollo* )
  431.     machine=apollo opsys=bsd4-2
  432.   ;;
  433.  
  434.   ## AT&T 3b2, 3b5, 3b15, 3b20
  435.   we32k-att-sysv* )
  436.     machine=att3b opsys=usg5-2-2
  437.   ;;
  438.  
  439.   ## AT&T 3b1 - The Mighty Unix PC!
  440.   m68*-att-sysv* )
  441.     machine=7300 opsys=usg5-2-2
  442.   ;;
  443.  
  444.   ## Bull sps7
  445.   m68*-bull-sysv* )
  446.     machine=sps7 opsys=usg5-2
  447.   ;;
  448.  
  449.   ## CCI 5/32, 6/32 -- see "Tahoe".
  450.  
  451.   ## Celerity
  452.   ## I don't know what configuration name to use for this; config.sub
  453.   ## doesn't seem to know anything about it.  Hey, Celerity users, get
  454.   ## in touch with us!
  455.   celerity-celerity-bsd* )
  456.     machine=celerity opsys=bsd4-2
  457.   ;;
  458.  
  459.   ## Clipper
  460.   ## What operating systems does this chip run that Emacs has been
  461.   ## tested on?
  462.   clipper-* )
  463.     machine=clipper
  464.     ## We'll use the catch-all code at the bottom to guess the
  465.     ## operating system.
  466.   ;;
  467.  
  468.   ## Convex
  469.   *-convex-bsd* )
  470.     machine=convex opsys=bsd4-3
  471.   ;;
  472.  
  473.   ## Cubix QBx/386
  474.   i386-cubix-sysv* )
  475.     machine=intel386 opsys=usg5-3
  476.   ;;
  477.  
  478.   ## Cydra 5
  479.   cydra*-cydrome-sysv* )
  480.     machine=cydra5 opsys=usg5-3
  481.   ;;
  482.  
  483.   ## Data General AViiON Machines
  484.   m88k-dg-dgux* )
  485.     machine=aviion opsys=dgux
  486.   ;;
  487.  
  488.   ## DECstations
  489.   mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0 | mips-dec-bsd4.2 )
  490.     machine=pmax opsys=bsd4-2
  491.   ;;
  492.   mips-dec-ultrix* | mips-dec-bsd* )
  493.     machine=pmax opsys=bsd4-3
  494.   ;;
  495.   mips-dec-osf* )
  496.     machine=pmax opsys=osf1
  497.   ;;
  498.  
  499.   ## Motorola Delta machines
  500.   m68*-motorola-sysv* )
  501.     machine=delta opsys=usg5-3
  502.   ;;
  503.   m88k-motorola-sysv4* )
  504.     machine=delta88k opsys=usg5-4
  505.   ;;
  506.   m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
  507.     machine=delta88k opsys=usg5-3
  508.   ;;
  509.  
  510.   ## Dual machines
  511.   m68*-dual-sysv* )
  512.     machine=dual opsys=usg5-2
  513.   ;;
  514.   m68*-dual-uniplus* )
  515.     machine=dual opsys=unipl5-2
  516.   ;;
  517.  
  518.   ## Elxsi 6400
  519.   elxsi-elxsi-sysv* )
  520.     machine=elxsi opsys=usg5-2
  521.   ;;
  522.  
  523.   ## Encore machines
  524.   ns16k-encore-bsd* )
  525.     machine=ns16000 opsys=umax
  526.   ;;
  527.  
  528.   ## The GEC 93 - apparently, this port isn't really finished yet.
  529.  
  530.   ## Gould Power Node and NP1
  531.   pn-gould-bsd4.2 )
  532.     machine=gould opsys=bsd4-2
  533.   ;;
  534.   pn-gould-bsd4.3 )
  535.     machine=gould opsys=bsd4-3
  536.   ;;
  537.   np1-gould-bsd* )
  538.     machine=gould-np1 opsys=bsd4-3
  539.   ;;
  540.  
  541.   ## Honeywell XPS100
  542.   xps*-honeywell-sysv* )
  543.     machine=xps100 opsys=usg5-2
  544.   ;;
  545.  
  546.   ## HP 9000 series 200 or 300
  547.   m68*-hp-bsd* )
  548.     machine=hp9000s300 opsys=bsd4-3
  549.   ;;
  550.   ## HP/UX 7, 8 and 9 are supported on these machines.
  551.   m68*-hp-hpux* )
  552.     case "`uname -r`" in
  553.       *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
  554.       *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
  555.       *) machine=hp9000s300 opsys=hpux ;;
  556.     esac
  557.   ;;
  558.  
  559.   ## HP 9000 series 700 and 800, running HP/UX
  560.   hppa*-hp-hpux7* )
  561.     machine=hp9000s800 opsys=hpux
  562.   ;;
  563.   hppa*-hp-hpux8* )
  564.     machine=hp9000s800 opsys=hpux8
  565.   ;;
  566.   hppa*-hp-hpux9* )
  567.     machine=hp9000s800 opsys=hpux9
  568.   ;;
  569.  
  570.   ## HP 9000 series 700 and 800, running HP/UX
  571.   hppa*-hp-hpux* )
  572.     ## Cross-compilation?  Nah!
  573.     case "`uname -r`" in
  574.       *.08.* ) machine=hp9000s800 opsys=hpux8 ;;
  575.       *.09.* ) machine=hp9000s800 opsys=hpux9 ;;
  576.       *) machine=hp9000s800 opsys=hpux ;;
  577.     esac
  578.   ;;
  579.  
  580.   ## Orion machines
  581.   orion-orion-bsd* )
  582.     machine=orion opsys=bsd4-2
  583.   ;;
  584.   clipper-orion-bsd* )
  585.     machine=orion105 opsys=bsd4-2
  586.   ;;
  587.  
  588.   ## IBM machines
  589.   i386-ibm-aix1.1 )
  590.     machine=ibmps2-aix opsys=usg5-2-2
  591.   ;;
  592.   i386-ibm-aix1.[23] | i386-ibm-aix* )
  593.     machine=ibmps2-aix opsys=usg5-3
  594.   ;;
  595.   rs6000-ibm-aix3.1 )
  596.     machine=ibmrs6000 opsys=aix3-1
  597.   ;;
  598.   rs6000-ibm-aix3.2 | rs6000-ibm-aix* )
  599.     machine=ibmrs6000 opsys=aix3-2
  600.   ;;
  601.   romp-ibm-bsd4-3 )
  602.     machine=ibmrt opsys=bsd4-3
  603.   ;;    
  604.   romp-ibm-bsd4-2 )
  605.     machine=ibmrt opsys=bsd4-2
  606.   ;;
  607.   romp-ibm-aos4-3 )
  608.     machine=ibmrt opsys=bsd4-3
  609.   ;;    
  610.   romp-ibm-aos4-2 )
  611.     machine=ibmrt opsys=bsd4-2
  612.   ;;
  613.   romp-ibm-aos* )
  614.     machine=ibmrt opsys=bsd4-3
  615.   ;;
  616.   romp-ibm-bsd* )
  617.     machine=ibmrt opsys=bsd4-3
  618.   ;;
  619.   romp-ibm-aix* )
  620.     machine=ibmrt-aix opsys=usg5-2-2
  621.   ;;
  622.  
  623.   ## Integrated Solutions `Optimum V'
  624.   m68*-isi-bsd4.2 )
  625.     machine=isi-ov opsys=bsd4-2
  626.   ;;
  627.   m68*-isi-bsd4.3 )
  628.     machine=isi-ov opsys=bsd4-3
  629.   ;;
  630.  
  631.   ## Intel 386 machines where we do care about the manufacturer
  632.   i[34]86-intsys-sysv* )
  633.     machine=is386 opsys=usg5-2-2
  634.   ;;
  635.  
  636.   ## Prime EXL
  637.   i386-prime-sysv* )
  638.     machine=i386 opsys=usg5-3
  639.   ;;
  640.  
  641.   ## Sequent Symmetry
  642.   i386-sequent-bsd* )
  643.     machine=symmetry opsys=bsd4-3
  644.   ;;
  645.  
  646.   ## Intel 860
  647.   i860-*-sysvr4 )
  648.     machine=i860 opsys=usg5-4
  649.   ;;
  650.  
  651.   ## Silicon Graphics machines
  652.   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
  653.   m68*-sgi-iris3.5 )
  654.     machine=irist opsys=iris3-5
  655.   ;;
  656.   m68*-sgi-iris3.6 | m68*-sgi-iris*)
  657.     machine=irist opsys=iris3-6
  658.   ;;
  659.   ## Iris 4D
  660.   mips-sgi-irix3.* )
  661.     machine=iris4d opsys=irix3-3
  662.   ;;
  663.   mips-sgi-irix4.* | mips-sgi-irix* )
  664.     machine=iris4d opsys=irix4-0
  665.   ;;
  666.  
  667.   ## Masscomp machines
  668.   m68*-masscomp-rtu )
  669.     machine=masscomp opsys=rtu
  670.   ;;
  671.  
  672.   ## Megatest machines
  673.   m68*-megatest-bsd* )
  674.     machine=mega68 opsys=bsd4-2
  675.   ;;
  676.  
  677.   ## Workstations sold by MIPS
  678.   ## This is not necessarily all workstations using the MIPS processor -
  679.   ## Irises are produced by SGI, and DECstations by DEC.
  680.  
  681.   ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
  682.   ## and usg5-2-2 and bsd4-3 as possible OS files.  The only guidance
  683.   ## it gives for choosing between the alternatives seems to be "Use
  684.   ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
  685.   ## the BSD world."  I'll assume that these are instructions for
  686.   ## handling two odd situations, and that every other situation
  687.   ## should use mips.h and usg5-2-2, they being listed first.
  688.   mips-mips-usg* )
  689.     machine=mips4
  690.     ## Fall through to the general code at the bottom to decide on the OS.
  691.   ;;
  692.   mips-mips-riscos4* )
  693.     machine=mips4 opsys=bsd4-3
  694.   ;;
  695.   mips-mips-bsd* )
  696.     machine=mips opsys=bsd4-3
  697.   ;;
  698.   mips-mips-* )
  699.     machine=mips opsys=usg5-2-2
  700.   ;;
  701.  
  702.   ## NeXT
  703.   m68*-next-mach* | m68*-next-bsd* )
  704.     machine=next opsys=mach2
  705.   ;;
  706.  
  707.   ## The complete machine from National Semiconductor
  708.   ns32k-ns-genix* )
  709.     machine=ns32000 opsys=usg5-2
  710.   ;;
  711.  
  712.   ## NCR machines
  713.   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
  714.     machine=tower32 opsys=usg5-2-2
  715.   ;;
  716.   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
  717.     machine=tower32v3 opsys=usg5-3
  718.   ;;
  719.  
  720.   ## Nixdorf Targon 31
  721.   m68*-nixdorf-sysv* )
  722.     machine=targon31 opsys=usg5-2-2
  723.   ;;
  724.  
  725.   ## Nu (TI or LMI)
  726.   m68*-nu-sysv* )
  727.     machine=nu opsys=usg5-2
  728.   ;;
  729.  
  730.   ## Plexus
  731.   m68*-plexus-sysv* )
  732.     machine=plexus opsys=usg5-2
  733.   ;;
  734.  
  735.   ## Pyramid machines
  736.   ## I don't really have any idea what sort of processor the Pyramid has,
  737.   ## so I'm assuming it is its own architecture.
  738.   pyramid-pyramid-bsd* )
  739.     machine=pyramid opsys=bsd4-2
  740.   ;;
  741.  
  742.   ## Sequent Balance
  743.   ns32k-sequent-bsd4.2 )
  744.     machine=sequent opsys=bsd4-2
  745.   ;;
  746.   ns32k-sequent-bsd4.3 )
  747.     machine=sequent opsys=bsd4-3
  748.   ;;
  749.  
  750.   ## SONY machines
  751.   m68*-sony-bsd4.2 )
  752.     machine=news opsys=bsd4-2
  753.   ;;
  754.   m68*-sony-bsd4.3 )
  755.     machine=news opsys=bsd4-3
  756.   ;;
  757.   mips-sony-bsd* )
  758.     machine=news-risc opsys=bsd4-3
  759.   ;;
  760.  
  761.   ## Stride
  762.   m68*-stride-sysv* )
  763.     machine=stride opsys=usg5-2
  764.   ;;
  765.  
  766.   ## Suns
  767.   *-sun-sunos* | *-sun-bsd* | *-sun-solaris* )
  768.     case "${configuration}" in
  769.       m68*-sunos1* )    machine=sun1 ;;
  770.       m68*-sunos2* )    machine=sun2 ;;
  771.       m68* )        machine=sun3 ;;
  772.       i[34]86* )    machine=sun386 ;;
  773.       sparc* )        machine=sparc ;;
  774.       * )        unported=true ;;
  775.     esac
  776.     case "${configuration}" in
  777.       *-sunos4.0*      ) opsys=sunos4-0 ;;
  778.       *-sunos4.1.3*      ) opsys=sunos4-1-3 ;;
  779.       *-sunos4* | *-sunos ) opsys=sunos4-1 ;;
  780.       *-sunos5* | *-solaris* ) opsys=sol2 ;;
  781.       *              ) opsys=bsd4-2   ;;
  782.     esac
  783.   ;;
  784.  
  785.   ## Tadpole 68k
  786.   m68*-tadpole-sysv* )
  787.     machine=tad68k opsys=usg5-3
  788.   ;;
  789.  
  790.   ## Tahoe machines
  791.   tahoe-tahoe-bsd4.2 )
  792.     machine=tahoe opsys=bsd4-2
  793.   ;;
  794.   tahoe-tahoe-bsd4.3 )
  795.     machine=tahoe opsys=bsd4-3
  796.   ;;
  797.  
  798.   ## Tandem Integrity S2
  799.   mips-tandem-sysv* )
  800.     machine=tandem-s2 opsys=usg5-3
  801.   ;;
  802.  
  803.   ## Tektronix XD88
  804.   m88k-tektronix-sysv3 )
  805.   machine=tekXD88 opsys=usg5-3
  806.   ;;
  807.  
  808.   ## Tektronix 16000 box (6130?)
  809.   ns16k-tektronix-bsd* )
  810.     machine=ns16000 opsys=bsd4-2
  811.   ;;
  812.   ## Tektronix 4300
  813.   ## src/m/tek4300.h hints that this is a m68k machine.
  814.   m68*-tektronix-bsd* )
  815.     machine=tex4300 opsys=bsd4-3
  816.   ;;
  817.  
  818.   ## Titan P2 or P3
  819.   ## We seem to have lost the machine-description file titan.h!
  820.   titan-titan-sysv* )
  821.     machine=titan opsys=usg5-3
  822.   ;;
  823.   
  824.   ## Ustation E30 (SS5E)
  825.   m68*-unisys-uniplus* )
  826.     machine=ustation opsystem=unipl5-2
  827.   ;;
  828.  
  829.   ## Vaxen.
  830.   vax-dec-* )
  831.     machine=vax
  832.     case "${configuration}" in
  833.       *-bsd4.1 )                     opsys=bsd4-1 ;;
  834.       *-bsd4.2 | *-ultrix[0-3].* | *-ultrix4.0 )    opsys=bsd4-2 ;;
  835.       *-bsd4.3 | *-ultrix* )                 opsys=bsd4-3 ;;
  836.       *-bsd386 )                    opsys=bsd386 ;;
  837.       *-sysv[01]* | *-sysvr[01]* )             opsys=usg5-0 ;;
  838.       *-sysv2* | *-sysvr2* )                opsys=usg5-2 ;;
  839.       *-vms* )                         opsys=vms ;;
  840.       * )                         unported=true
  841.     esac
  842.   ;;
  843.  
  844.   ## Whitechapel MG1
  845.   ns16k-whitechapel-* )
  846.     machine=mg1
  847.     ## We don't know what sort of OS runs on these; we'll let the
  848.     ## operating system guessing code below try.
  849.   ;;
  850.  
  851.   ## Wicat
  852.   m68*-wicat-sysv* )
  853.     machine=wicat opsys=usg5-2
  854.   ;;
  855.  
  856.   ## Intel 386 machines where we don't care about the manufacturer
  857.   i[34]86-*-* )
  858.     machine=intel386
  859.     case "${configuration}" in
  860.       *-isc1.* | *-isc2.[01]* )    opsys=386-ix ;;
  861.       *-isc2.2 )        opsys=isc2-2 ;;
  862.       *-isc* )            opsys=isc3-0 ;;
  863.       *-esix5* )        opsys=esix5r4 ;;
  864.       *-esix* )            opsys=esix ;;
  865.       *-xenix* )        opsys=xenix ;;
  866.       *-linux* )        opsys=linux ;;
  867.       *-sco3.2v4* )        opsys=sco4 ;;
  868.       *-bsd386* )        opsys=bsd386 ;;
  869.       *-386bsd )            opsys=386bsd ;;
  870.       ## Otherwise, we'll fall through to the generic opsys code at the bottom.
  871.     esac
  872.   ;;
  873.  
  874.   * )
  875.     unported=true
  876.   ;;
  877. esac
  878.  
  879. ### If the code above didn't choose an operating system, just choose
  880. ### an operating system based on the configuration name.  You really
  881. ### only want to use this when you have no idea what the right
  882. ### operating system is; if you know what operating systems a machine
  883. ### runs, it's cleaner to make it explicit in the case statement
  884. ### above.
  885. if [ x"${opsys}" = x ]; then
  886.   case "${configuration}" in
  887.     *-bsd4.[01] )    opsys=bsd4-1 ;;
  888.     *-bsd4.2 )        opsys=bsd4-2 ;;
  889.     *-bsd4.3 )        opsys=bsd4-3 ;;
  890.     *-sysv0 | *-sysvr0 )        opsys=usg5-0 ;;
  891.     *-sysv2 | *-sysvr2 )        opsys=usg5-2 ;;
  892.     *-sysv2.2 | *-sysvr2.2 )        opsys=usg5-2-2 ;;
  893.     *-sysv3 | *-sysvr3 )        opsys=usg5-3 ;;
  894.     *-sysv4 | *-sysvr4 )        opsys=usg5-4 ;;
  895.     *-sysv4.2 | *-sysvr4.2 )        opsys=usg5-4-2 ;;
  896.     * )
  897.       unported=true
  898.     ;;
  899.   esac
  900. fi
  901.  
  902. if $unported ; then
  903.   (echo "${progname}: Emacs hasn't been ported to \`${configuration}' systems."
  904.    echo "${progname}: Check \`etc/MACHINES' for recognized configuration names."
  905.   ) >&2
  906.   exit 1
  907. fi
  908.  
  909. machfile="m/${machine}.h"
  910. opsysfile="s/${opsys}.h"
  911.  
  912.  
  913. trap 'rm -f conftest* core; exit 1' 1 3 15
  914.  
  915. # NLS nuisances.
  916. # These must not be set unconditionally because not all systems understand
  917. # e.g. LANG=C (notably SCO).
  918. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  919. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  920.  
  921. rm -f conftest*
  922. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  923.  
  924. # A filename unique to this package, relative to the directory that
  925. # configure is in, which we can look for to find out if srcdir is correct.
  926. unique_file=lisp
  927.  
  928. # Find the source files, if location was not specified.
  929. if test -z "$srcdir"; then
  930.   srcdirdefaulted=yes
  931.   # Try the directory containing this script, then `..'.
  932.   prog=$0
  933.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  934.   test "X$confdir" = "X$prog" && confdir=.
  935.   srcdir=$confdir
  936.   if test ! -r $srcdir/$unique_file; then
  937.     srcdir=..
  938.   fi
  939. fi
  940. if test ! -r $srcdir/$unique_file; then
  941.   if test x$srcdirdefaulted = xyes; then
  942.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  943.   else
  944.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  945.   fi
  946.   exit 1
  947. fi
  948. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  949. # But we can't avoid them for `..', to make subdirectories work.
  950. case $srcdir in
  951.   .|/*|~*) ;;
  952.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  953. esac
  954.  
  955. # Save the original args to write them into config.status later.
  956. configure_args="$*"
  957.  
  958.  
  959.  
  960.  
  961. #### Choose a compiler.
  962. case ${with_gcc} in
  963.   "yes" ) CC="gcc" GCC=1 ;;
  964.   "no"  ) CC="cc"        ;;
  965.   * )
  966.      if test -z "$CC"; then
  967.   # Extract the first word of `gcc', so it can be a program name with args.
  968.   set dummy gcc; word=$2
  969.   echo checking for $word
  970.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  971.   for dir in $PATH; do
  972.     test -z "$dir" && dir=.
  973.     if test -f $dir/$word; then
  974.       CC="gcc"
  975.       break
  976.     fi
  977.   done
  978.   IFS="$saveifs"
  979. fi
  980. test -z "$CC" && CC="cc"
  981. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  982.  
  983. # Find out if we are using GNU C, under whatever name.
  984. cat > conftest.c <<EOF
  985. #ifdef __GNUC__
  986.   yes
  987. #endif
  988. EOF
  989. ${CC-cc} -E conftest.c > conftest.out 2>&1
  990. if egrep yes conftest.out >/dev/null 2>&1; then
  991.   GCC=1 # For later tests.
  992. fi
  993. rm -f conftest*
  994.  
  995. esac
  996.  
  997. #### Some other nice autoconf tests.  If you add a test here which
  998. #### should make an entry in src/config.h, don't forget to add an
  999. #### #undef clause to src/config.h.in for autoconf to modify.
  1000.  
  1001. echo checking for ln -s
  1002. rm -f conftestdata
  1003. if ln -s X conftestdata 2>/dev/null
  1004. then
  1005.   rm -f conftestdata
  1006.   LN_S="ln -s"
  1007. else
  1008.   LN_S=ln
  1009. fi
  1010.  
  1011.  
  1012. echo checking how to run the C preprocessor
  1013. if test -z "$CPP"; then
  1014.   # This must be in double quotes, not single quotes, because CPP may get
  1015.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  1016.   # make.  It must be expanded now.
  1017.   CPP="${CC-cc} -E"
  1018.   cat > conftest.c <<EOF
  1019. #include <stdio.h>
  1020. Syntax Error
  1021. EOF
  1022. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  1023. if test -z "$err"; then
  1024.   :
  1025. else
  1026.   CPP=/lib/cpp
  1027. fi
  1028. rm -f conftest*
  1029. fi
  1030. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  1031.  
  1032. # Make sure to not get the incompatible SysV /etc/install and
  1033. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  1034. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  1035. # or the AFS install, which mishandles nonexistent args, or
  1036. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  1037. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  1038. # anyway.  Sigh.
  1039. if test "z${INSTALL}" = "z" ; then
  1040.   echo checking for install
  1041.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  1042.   for dir in $PATH; do
  1043.     test -z "$dir" && dir=.
  1044.     case $dir in
  1045.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  1046.     *)
  1047.       if test -f $dir/installbsd; then
  1048.     INSTALL="$dir/installbsd -c" # OSF1
  1049.     INSTALL_PROGRAM='$(INSTALL)'
  1050.     INSTALL_DATA='$(INSTALL) -m 644'
  1051.     break
  1052.       fi
  1053.       if test -f $dir/install; then
  1054.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  1055.       : # AIX
  1056.     else
  1057.       INSTALL="$dir/install -c"
  1058.       INSTALL_PROGRAM='$(INSTALL)'
  1059.       INSTALL_DATA='$(INSTALL) -m 644'
  1060.       break
  1061.     fi
  1062.       fi
  1063.       ;;
  1064.     esac
  1065.   done
  1066.   IFS="$saveifs"
  1067. fi
  1068. INSTALL=${INSTALL-cp}
  1069. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  1070. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  1071.  
  1072. for p in 'bison -y' byacc
  1073. do
  1074. if test -z "$YACC"; then
  1075.   # Extract the first word of `$p', so it can be a program name with args.
  1076.   set dummy $p; word=$2
  1077.   echo checking for $word
  1078.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  1079.   for dir in $PATH; do
  1080.     test -z "$dir" && dir=.
  1081.     if test -f $dir/$word; then
  1082.       YACC="$p"
  1083.       break
  1084.     fi
  1085.   done
  1086.   IFS="$saveifs"
  1087. fi
  1088.  
  1089. test -n "$YACC" -a -n "$verbose" && echo "    setting YACC to $YACC"
  1090.  
  1091. test -n "$YACC" && break
  1092. done
  1093. test -n "$YACC" || YACC="yacc"
  1094.  
  1095.  
  1096.  
  1097. for hdr in sys/timeb.h sys/time.h
  1098. do
  1099. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  1100. echo checking for ${hdr}
  1101. cat > conftest.c <<EOF
  1102. #include <${hdr}>
  1103. EOF
  1104. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  1105. if test -z "$err"; then
  1106.   {
  1107. test -n "$verbose" && \
  1108. echo '    defining' ${trhdr}
  1109. DEFS="$DEFS -D${trhdr}=1"
  1110. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  1111. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  1112. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  1113. "
  1114. }
  1115.  
  1116. fi
  1117. rm -f conftest*
  1118. done
  1119.  
  1120. echo checking for ANSI C header files
  1121. cat > conftest.c <<EOF
  1122. #include <stdlib.h>
  1123. #include <stdarg.h>
  1124. #include <string.h>
  1125. #include <float.h>
  1126. EOF
  1127. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  1128. if test -z "$err"; then
  1129.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  1130. echo '#include <string.h>' > conftest.c
  1131. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  1132. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  1133.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  1134. cat > conftest.c <<EOF
  1135. #include <ctype.h>
  1136. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  1137. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  1138. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  1139. int main () { int i; for (i = 0; i < 256; i++)
  1140. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  1141. exit (0); }
  1142.  
  1143. EOF
  1144. eval $compile
  1145. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1146.   {
  1147. test -n "$verbose" && \
  1148. echo '    defining' STDC_HEADERS
  1149. DEFS="$DEFS -DSTDC_HEADERS=1"
  1150. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  1151. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  1152. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  1153. "
  1154. }
  1155.  
  1156. fi
  1157. rm -f conftest*
  1158. fi
  1159. rm -f conftest*
  1160.  
  1161. fi
  1162. rm -f conftest*
  1163.  
  1164. echo checking for whether time.h and sys/time.h may both be included
  1165. cat > conftest.c <<EOF
  1166. #include <sys/types.h>
  1167. #include <sys/time.h>
  1168. #include <time.h>
  1169. int main() { exit(0); }
  1170. int t() { struct tm *tp; }
  1171. EOF
  1172. if eval $compile; then
  1173.   {
  1174. test -n "$verbose" && \
  1175. echo '    defining' TIME_WITH_SYS_TIME
  1176. DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
  1177. SEDDEFS="${SEDDEFS}\${SEDdA}TIME_WITH_SYS_TIME\${SEDdB}TIME_WITH_SYS_TIME\${SEDdC}1\${SEDdD}
  1178. \${SEDuA}TIME_WITH_SYS_TIME\${SEDuB}TIME_WITH_SYS_TIME\${SEDuC}1\${SEDuD}
  1179. \${SEDeA}TIME_WITH_SYS_TIME\${SEDeB}TIME_WITH_SYS_TIME\${SEDeC}1\${SEDeD}
  1180. "
  1181. }
  1182.  
  1183. fi
  1184. rm -f conftest*
  1185.  
  1186.  
  1187. LIBS_save="${LIBS}"
  1188. LIBS="${LIBS} -ldnet"
  1189. have_lib=""
  1190. echo checking for -ldnet
  1191. cat > conftest.c <<EOF
  1192.  
  1193. int main() { exit(0); }
  1194. int t() { main(); }
  1195. EOF
  1196. if eval $compile; then
  1197.   have_lib="1"
  1198. fi
  1199. rm -f conftest*
  1200. LIBS="${LIBS_save}"
  1201. if test -n "${have_lib}"; then
  1202.    {
  1203. test -n "$verbose" && \
  1204. echo '    defining' HAVE_LIBDNET
  1205. DEFS="$DEFS -DHAVE_LIBDNET=1"
  1206. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDNET\${SEDdB}HAVE_LIBDNET\${SEDdC}1\${SEDdD}
  1207. \${SEDuA}HAVE_LIBDNET\${SEDuB}HAVE_LIBDNET\${SEDuC}1\${SEDuD}
  1208. \${SEDeA}HAVE_LIBDNET\${SEDeB}HAVE_LIBDNET\${SEDeC}1\${SEDeD}
  1209. "
  1210. }
  1211.  
  1212.    LIBS="${LIBS} -ldnet"
  1213. fi
  1214.  
  1215.  
  1216. echo checking for return type of signal handlers
  1217. cat > conftest.c <<EOF
  1218. #include <sys/types.h>
  1219. #include <signal.h>
  1220. #ifdef signal
  1221. #undef signal
  1222. #endif
  1223. extern void (*signal ()) ();
  1224. int main() { exit(0); }
  1225. int t() { int i; }
  1226. EOF
  1227. if eval $compile; then
  1228.   {
  1229. test -n "$verbose" && \
  1230. echo '    defining' RETSIGTYPE to be 'void'
  1231. DEFS="$DEFS -DRETSIGTYPE=void"
  1232. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  1233. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  1234. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  1235. "
  1236. }
  1237.  
  1238. else
  1239.   {
  1240. test -n "$verbose" && \
  1241. echo '    defining' RETSIGTYPE to be 'int'
  1242. DEFS="$DEFS -DRETSIGTYPE=int"
  1243. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  1244. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  1245. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  1246. "
  1247. }
  1248.  
  1249. fi
  1250. rm -f conftest*
  1251.  
  1252.  
  1253.  
  1254. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  1255. # for constant arguments.  Useless!
  1256. echo checking for working alloca.h
  1257. cat > conftest.c <<EOF
  1258. #include <alloca.h>
  1259. int main() { exit(0); }
  1260. int t() { char *p = alloca(2 * sizeof(int)); }
  1261. EOF
  1262. if eval $compile; then
  1263.   {
  1264. test -n "$verbose" && \
  1265. echo '    defining' HAVE_ALLOCA_H
  1266. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  1267. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  1268. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  1269. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  1270. "
  1271. }
  1272.  
  1273. fi
  1274. rm -f conftest*
  1275.  
  1276. decl="#ifdef __GNUC__
  1277. #define alloca __builtin_alloca
  1278. #else
  1279. #if HAVE_ALLOCA_H
  1280. #include <alloca.h>
  1281. #else
  1282. #ifdef _AIX
  1283.  #pragma alloca
  1284. #else
  1285. char *alloca ();
  1286. #endif
  1287. #endif
  1288. #endif
  1289. "
  1290. echo checking for alloca
  1291. cat > conftest.c <<EOF
  1292. $decl
  1293. int main() { exit(0); }
  1294. int t() { char *p = (char *) alloca(1); }
  1295. EOF
  1296. if eval $compile; then
  1297.   :
  1298. else
  1299.   alloca_missing=1
  1300. cat > conftest.c <<EOF
  1301.  
  1302. #if defined(CRAY) && ! defined(CRAY2)
  1303. winnitude
  1304. #else
  1305. lossage
  1306. #endif
  1307.  
  1308. EOF
  1309. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  1310. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  1311.   echo checking for _getb67
  1312. cat > conftest.c <<EOF
  1313. #include <ctype.h>
  1314. int main() { exit(0); }
  1315. int t() { 
  1316. /* The GNU C library defines this for functions which it implements
  1317.     to always fail with ENOSYS.  Some functions are actually named
  1318.     something starting with __ and the normal name is an alias.  */
  1319. #if defined (__stub__getb67) || defined (__stub____getb67)
  1320. choke me
  1321. #else
  1322. /* Override any gcc2 internal prototype to avoid an error.  */
  1323. extern char _getb67(); _getb67();
  1324. #endif
  1325.  }
  1326. EOF
  1327. if eval $compile; then
  1328.   {
  1329. test -n "$verbose" && \
  1330. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  1331. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  1332. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  1333. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  1334. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  1335. "
  1336. }
  1337.  
  1338. else
  1339.   echo checking for GETB67
  1340. cat > conftest.c <<EOF
  1341. #include <ctype.h>
  1342. int main() { exit(0); }
  1343. int t() { 
  1344. /* The GNU C library defines this for functions which it implements
  1345.     to always fail with ENOSYS.  Some functions are actually named
  1346.     something starting with __ and the normal name is an alias.  */
  1347. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1348. choke me
  1349. #else
  1350. /* Override any gcc2 internal prototype to avoid an error.  */
  1351. extern char GETB67(); GETB67();
  1352. #endif
  1353.  }
  1354. EOF
  1355. if eval $compile; then
  1356.   {
  1357. test -n "$verbose" && \
  1358. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  1359. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1360. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1361. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1362. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1363. "
  1364. }
  1365.  
  1366. else
  1367.   echo checking for getb67
  1368. cat > conftest.c <<EOF
  1369. #include <ctype.h>
  1370. int main() { exit(0); }
  1371. int t() { 
  1372. /* The GNU C library defines this for functions which it implements
  1373.     to always fail with ENOSYS.  Some functions are actually named
  1374.     something starting with __ and the normal name is an alias.  */
  1375. #if defined (__stub_getb67) || defined (__stub___getb67)
  1376. choke me
  1377. #else
  1378. /* Override any gcc2 internal prototype to avoid an error.  */
  1379. extern char getb67(); getb67();
  1380. #endif
  1381.  }
  1382. EOF
  1383. if eval $compile; then
  1384.   {
  1385. test -n "$verbose" && \
  1386. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  1387. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1388. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1389. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1390. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1391. "
  1392. }
  1393.  
  1394. fi
  1395. rm -f conftest*
  1396.  
  1397. fi
  1398. rm -f conftest*
  1399.  
  1400. fi
  1401. rm -f conftest*
  1402.  
  1403. fi
  1404. rm -f conftest*
  1405.  
  1406.  
  1407. fi
  1408. rm -f conftest*
  1409.  
  1410. if test -n "$alloca_missing"; then
  1411.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1412.   # that cause trouble.  Some versions do not even contain alloca or
  1413.   # contain a buggy version.  If you still want to use their alloca,
  1414.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1415.   ALLOCA=alloca.o
  1416.  
  1417.   echo 'checking stack direction for C alloca'
  1418.   echo checking whether cross-compiling
  1419. # If we cannot run a trivial program, we must be cross compiling.
  1420. cat > conftest.c <<EOF
  1421. main(){exit(0);}
  1422. EOF
  1423. eval $compile
  1424. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1425.   :
  1426. else
  1427.   cross_compiling=1
  1428. fi
  1429. rm -f conftest*
  1430.  
  1431. if test -n "$cross_compiling"
  1432. then
  1433.   {
  1434. test -n "$verbose" && \
  1435. echo '    defining' STACK_DIRECTION to be '0'
  1436. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1437. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1438. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1439. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1440. "
  1441. }
  1442.  
  1443. else
  1444. cat > conftest.c <<EOF
  1445. find_stack_direction ()
  1446. {
  1447.   static char *addr = 0;
  1448.   auto char dummy;
  1449.   if (addr == 0)
  1450.     {
  1451.       addr = &dummy;
  1452.       return find_stack_direction ();
  1453.     }
  1454.   else
  1455.     return (&dummy > addr) ? 1 : -1;
  1456. }
  1457. main ()
  1458. {
  1459.   exit (find_stack_direction() < 0);
  1460. }
  1461. EOF
  1462. eval $compile
  1463. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1464.   {
  1465. test -n "$verbose" && \
  1466. echo '    defining' STACK_DIRECTION to be '1'
  1467. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1468. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1469. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1470. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1471. "
  1472. }
  1473.  
  1474. else
  1475.   {
  1476. test -n "$verbose" && \
  1477. echo '    defining' STACK_DIRECTION to be '-1'
  1478. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1479. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1480. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1481. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1482. "
  1483. }
  1484.  
  1485. fi
  1486. fi
  1487. rm -f conftest*
  1488. fi
  1489.  
  1490. for func in gettimeofday gethostname dup2 rename closedir
  1491. do
  1492. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1493. echo checking for ${func}
  1494. cat > conftest.c <<EOF
  1495. #include <ctype.h>
  1496. int main() { exit(0); }
  1497. int t() { 
  1498. /* The GNU C library defines this for functions which it implements
  1499.     to always fail with ENOSYS.  Some functions are actually named
  1500.     something starting with __ and the normal name is an alias.  */
  1501. #if defined (__stub_${func}) || defined (__stub___${func})
  1502. choke me
  1503. #else
  1504. /* Override any gcc2 internal prototype to avoid an error.  */
  1505. extern char ${func}(); ${func}();
  1506. #endif
  1507.  }
  1508. EOF
  1509. if eval $compile; then
  1510.   {
  1511. test -n "$verbose" && \
  1512. echo '    defining' ${trfunc}
  1513. DEFS="$DEFS -D${trfunc}=1"
  1514. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1515. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1516. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1517. "
  1518. }
  1519.  
  1520. fi
  1521. rm -f conftest*
  1522. done
  1523.  
  1524.  
  1525. echo checking for struct tm in time.h
  1526. cat > conftest.c <<EOF
  1527. #include <sys/types.h>
  1528. #include <time.h>
  1529. int main() { exit(0); }
  1530. int t() { struct tm *tp; }
  1531. EOF
  1532. if eval $compile; then
  1533.   :
  1534. else
  1535.   {
  1536. test -n "$verbose" && \
  1537. echo '    defining' TM_IN_SYS_TIME
  1538. DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  1539. SEDDEFS="${SEDDEFS}\${SEDdA}TM_IN_SYS_TIME\${SEDdB}TM_IN_SYS_TIME\${SEDdC}1\${SEDdD}
  1540. \${SEDuA}TM_IN_SYS_TIME\${SEDuB}TM_IN_SYS_TIME\${SEDuC}1\${SEDuD}
  1541. \${SEDeA}TM_IN_SYS_TIME\${SEDeB}TM_IN_SYS_TIME\${SEDeC}1\${SEDeD}
  1542. "
  1543. }
  1544.  
  1545. fi
  1546. rm -f conftest*
  1547.  
  1548. decl='#include <sys/types.h>
  1549. '
  1550. case "$DEFS" in
  1551.   *TM_IN_SYS_TIME*) decl="$decl
  1552. #include <sys/time.h>
  1553. " ;;
  1554.   *) decl="$decl
  1555. #include <time.h>
  1556. " ;;
  1557. esac
  1558. echo checking for tm_zone in struct tm
  1559. cat > conftest.c <<EOF
  1560. $decl
  1561. int main() { exit(0); }
  1562. int t() { struct tm tm; tm.tm_zone; }
  1563. EOF
  1564. if eval $compile; then
  1565.   {
  1566. test -n "$verbose" && \
  1567. echo '    defining' HAVE_TM_ZONE
  1568. DEFS="$DEFS -DHAVE_TM_ZONE=1"
  1569. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_ZONE\${SEDdB}HAVE_TM_ZONE\${SEDdC}1\${SEDdD}
  1570. \${SEDuA}HAVE_TM_ZONE\${SEDuB}HAVE_TM_ZONE\${SEDuC}1\${SEDuD}
  1571. \${SEDeA}HAVE_TM_ZONE\${SEDeB}HAVE_TM_ZONE\${SEDeC}1\${SEDeD}
  1572. "
  1573. }
  1574.  
  1575. else
  1576.   no_tm_zone=1
  1577. fi
  1578. rm -f conftest*
  1579.  
  1580. if test -n "$no_tm_zone"; then
  1581. echo checking for tzname
  1582. cat > conftest.c <<EOF
  1583. #include <time.h>
  1584. #ifndef tzname /* For SGI.  */
  1585. extern char *tzname[]; /* RS6000 and others want it this way.  */
  1586. #endif
  1587. int main() { exit(0); }
  1588. int t() { atoi(*tzname); }
  1589. EOF
  1590. if eval $compile; then
  1591.   {
  1592. test -n "$verbose" && \
  1593. echo '    defining' HAVE_TZNAME
  1594. DEFS="$DEFS -DHAVE_TZNAME=1"
  1595. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TZNAME\${SEDdB}HAVE_TZNAME\${SEDdC}1\${SEDdD}
  1596. \${SEDuA}HAVE_TZNAME\${SEDuB}HAVE_TZNAME\${SEDuC}1\${SEDuD}
  1597. \${SEDeA}HAVE_TZNAME\${SEDeB}HAVE_TZNAME\${SEDeC}1\${SEDeD}
  1598. "
  1599. }
  1600.  
  1601. fi
  1602. rm -f conftest*
  1603.  
  1604. fi
  1605.  
  1606.  
  1607. prog='/* Ultrix mips cc rejects this.  */
  1608. typedef int charset[2]; const charset x;
  1609. /* SunOS 4.1.1 cc rejects this.  */
  1610. char const *const *ccp;
  1611. char **p;
  1612. /* AIX XL C 1.02.0.0 rejects this.
  1613.    It does not let you subtract one const X* pointer from another in an arm
  1614.    of an if-expression whose if-part is not a constant expression */
  1615. const char *g = "string";
  1616. ccp = &g + (g ? g-g : 0);
  1617. /* HPUX 7.0 cc rejects these. */
  1618. ++ccp;
  1619. p = (char**) ccp;
  1620. ccp = (char const *const *) p;
  1621. { /* SCO 3.2v4 cc rejects this.  */
  1622.   char *t;
  1623.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  1624.  
  1625.   *t++ = 0;
  1626. }
  1627. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  1628.   int x[] = {25,17};
  1629.   const int *foo = &x[0];
  1630.   ++foo;
  1631. }
  1632. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  1633.   typedef const int *iptr;
  1634.   iptr p = 0;
  1635.   ++p;
  1636. }
  1637. { /* AIX XL C 1.02.0.0 rejects this saying
  1638.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  1639.   struct s { int j; const int *ap[3]; };
  1640.   struct s *b; b->j = 5;
  1641. }'
  1642. echo checking for working const
  1643. cat > conftest.c <<EOF
  1644.  
  1645. int main() { exit(0); }
  1646. int t() { $prog }
  1647. EOF
  1648. if eval $compile; then
  1649.   :
  1650. else
  1651.   {
  1652. test -n "$verbose" && \
  1653. echo '    defining' const to be 'empty'
  1654. DEFS="$DEFS -Dconst="
  1655. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  1656. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  1657. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  1658. "
  1659. }
  1660.  
  1661. fi
  1662. rm -f conftest*
  1663.  
  1664.  
  1665. echo checking for long file names
  1666. lost=false
  1667. # Test for long file names in all the places we know might matter:
  1668. #      .        the current directory, where building will happen
  1669. #      /tmp        where it might want to write temporary files
  1670. #      /usr/tmp        likewise
  1671. #      $prefix        where we will be installing things
  1672. #      $exec_prefix    likewise
  1673. for dir in . /tmp /usr/tmp $prefix $exec_prefix ; do
  1674.   (echo 1 > $dir/conftest9012345) 2>/dev/null
  1675.   (echo 2 > $dir/conftest9012346) 2>/dev/null
  1676.   val=`cat $dir/conftest9012345 2>/dev/null`
  1677.   test -f $dir/conftest9012345 && test "$val" = 1 || lost=true
  1678.   rm -f $dir/conftest9012345 $dir/conftest9012346 2> /dev/null
  1679. done
  1680. $lost || {
  1681. test -n "$verbose" && \
  1682. echo '    defining' HAVE_LONG_FILE_NAMES
  1683. DEFS="$DEFS -DHAVE_LONG_FILE_NAMES=1"
  1684. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_FILE_NAMES\${SEDdB}HAVE_LONG_FILE_NAMES\${SEDdC}1\${SEDdD}
  1685. \${SEDuA}HAVE_LONG_FILE_NAMES\${SEDuB}HAVE_LONG_FILE_NAMES\${SEDuC}1\${SEDuD}
  1686. \${SEDeA}HAVE_LONG_FILE_NAMES\${SEDeB}HAVE_LONG_FILE_NAMES\${SEDeC}1\${SEDeD}
  1687. "
  1688. }
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695. #### Choose a window system.
  1696. echo "Checking window system."
  1697.  
  1698. window_system=''
  1699. case "${with_x}" in
  1700.   yes )
  1701.     window_system=${window_system}x11
  1702.   ;;
  1703.   no )
  1704.     window_system=${window_system}none
  1705. esac
  1706. case "${with_x11}" in
  1707.   yes )
  1708.     window_system=${window_system}x11
  1709.   ;;
  1710. esac
  1711. case "${with_x10}" in
  1712.   yes )
  1713.     window_system=${window_system}x10
  1714.   ;;
  1715. esac
  1716.  
  1717. case "${window_system}" in
  1718.   "none" | "x11" | "x10" ) ;;
  1719.   "" )
  1720.     echo "  No window system specified.  Looking for X11."
  1721.     window_system=none
  1722.     if [ -r /usr/lib/libX11.a \
  1723.      -o -d /usr/include/X11 \
  1724.          -o -d /usr/X386/include \
  1725.      -o -d ${x_includes}/X11 ]; then
  1726.       window_system=x11
  1727.     fi
  1728.   ;;
  1729.   * )
  1730.     echo "Don't specify the window system more than once." >&2
  1731.     exit 1
  1732.   ;;
  1733. esac
  1734.  
  1735. case "${window_system}" in
  1736.   x11 )
  1737.     HAVE_X_WINDOWS=yes
  1738.     HAVE_X11=yes
  1739.     echo "  Using X11."
  1740.   ;;
  1741.   x10 )
  1742.     HAVE_X_WINDOWS=yes
  1743.     HAVE_X11=no
  1744.     echo "  Using X10."
  1745.   ;;
  1746.   none )
  1747.     HAVE_X_WINDOWS=no
  1748.     HAVE_X11=no
  1749.     echo "  Using no window system."
  1750.   ;;
  1751. esac
  1752.  
  1753. ### If we're using X11, we should use the X menu package.
  1754. HAVE_X_MENU=no
  1755. case ${HAVE_X11} in
  1756.   yes )
  1757.     HAVE_X_MENU=yes
  1758.   ;;
  1759. esac
  1760.  
  1761. #### Extract some information from the operating system and machine files.
  1762.  
  1763. echo "Examining the machine- and system-dependent files to find out"
  1764. echo " - which libraries the lib-src programs will want, and"
  1765. echo " - whether the GNU malloc routines are usable."
  1766.  
  1767. ### It's not important that this name contain the PID; you can't run
  1768. ### two configures in the same directory and have anything work
  1769. ### anyway.
  1770. tempcname="conftest.c"
  1771.  
  1772. echo '
  1773. #include "'${srcdir}'/src/'${opsysfile}'"
  1774. #include "'${srcdir}'/src/'${machfile}'"
  1775. #ifndef LIBS_MACHINE
  1776. #define LIBS_MACHINE
  1777. #endif
  1778. #ifndef LIBS_SYSTEM
  1779. #define LIBS_SYSTEM
  1780. #endif
  1781. #ifndef C_SWITCH_SYSTEM
  1782. #define C_SWITCH_SYSTEM
  1783. #endif
  1784. @configure@ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
  1785. @configure@ c_switch_system=C_SWITCH_SYSTEM
  1786.  
  1787. #ifdef UNEXEC
  1788. @configure@ unexec=UNEXEC
  1789. #else
  1790. @configure@ unexec=unexec.o
  1791. #endif
  1792.  
  1793. #ifdef SYSTEM_MALLOC
  1794. @configure@ system_malloc=yes
  1795. #else
  1796. @configure@ system_malloc=no
  1797. #endif
  1798.  
  1799. #ifndef C_DEBUG_SWITCH
  1800. #define C_DEBUG_SWITCH -g
  1801. #endif
  1802.  
  1803. #ifndef C_OPTIMIZE_SWITCH
  1804. #define C_OPTIMIZE_SWITCH -O
  1805. #endif
  1806.  
  1807. #ifdef __GNUC__
  1808. @configure@ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH
  1809. #else
  1810. @configure@ CFLAGS=C_DEBUG_SWITCH
  1811. #endif
  1812. ' > ${tempcname}
  1813. # The value of CPP is a quoted variable reference, so we need to do this
  1814. # to get its actual value...
  1815. CPP=`eval "echo $CPP"`
  1816. eval `${CPP} -Isrc ${tempcname} \
  1817.        | grep '@configure@' \
  1818.        | sed -e 's/^@configure@ \([^=]*=\)\(.*\)$/\1"\2"/'`
  1819. rm ${tempcname}
  1820.  
  1821. ### Compute the unexec source name from the object name.
  1822. UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
  1823.  
  1824. # Do the opsystem or machine files prohibit the use of the GNU malloc?
  1825. # Assume not, until told otherwise.
  1826. GNU_MALLOC=yes
  1827. if [ "${system_malloc}" = "yes" ]; then
  1828.   GNU_MALLOC=no
  1829.   GNU_MALLOC_reason="
  1830.   (The GNU allocators don't work with this system configuration.)"
  1831. fi
  1832.  
  1833. if [ x"${REL_ALLOC}" = x ]; then
  1834.   REL_ALLOC=${GNU_MALLOC}
  1835. fi
  1836.  
  1837. LISP_FLOAT_TYPE=yes
  1838.  
  1839.  
  1840. #### Add the X libraries to the list, and check for some functions found there.
  1841. CFLAGS_save="$CFLAGS"
  1842. CFLAGS="${CFLAGS} ${LD_SWITCH_X_SITE}"
  1843.  
  1844. LIBS_save="${LIBS}"
  1845. LIBS="${LIBS} -lXbsd"
  1846. have_lib=""
  1847. echo checking for -lXbsd
  1848. cat > conftest.c <<EOF
  1849.  
  1850. int main() { exit(0); }
  1851. int t() { main(); }
  1852. EOF
  1853. if eval $compile; then
  1854.   have_lib="1"
  1855. fi
  1856. rm -f conftest*
  1857. LIBS="${LIBS_save}"
  1858. if test -n "${have_lib}"; then
  1859.    {
  1860. test -n "$verbose" && \
  1861. echo '    defining' HAVE_LIBXBSD
  1862. DEFS="$DEFS -DHAVE_LIBXBSD=1"
  1863. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBXBSD\${SEDdB}HAVE_LIBXBSD\${SEDdC}1\${SEDdD}
  1864. \${SEDuA}HAVE_LIBXBSD\${SEDuB}HAVE_LIBXBSD\${SEDuC}1\${SEDuD}
  1865. \${SEDeA}HAVE_LIBXBSD\${SEDeB}HAVE_LIBXBSD\${SEDeC}1\${SEDeD}
  1866. "
  1867. }
  1868.  
  1869.    LIBS="${LIBS} -lXbsd"
  1870. fi
  1871.  
  1872.  
  1873. LIBS_save="$LIBS"
  1874. if [ "${HAVE_X11}" = "yes" ] ; then
  1875.   LIBS="-lX11 ${LIBS}"
  1876. fi
  1877.  
  1878. for func in XrmSetDatabase random
  1879. do
  1880. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1881. echo checking for ${func}
  1882. cat > conftest.c <<EOF
  1883. #include <ctype.h>
  1884. int main() { exit(0); }
  1885. int t() { 
  1886. /* The GNU C library defines this for functions which it implements
  1887.     to always fail with ENOSYS.  Some functions are actually named
  1888.     something starting with __ and the normal name is an alias.  */
  1889. #if defined (__stub_${func}) || defined (__stub___${func})
  1890. choke me
  1891. #else
  1892. /* Override any gcc2 internal prototype to avoid an error.  */
  1893. extern char ${func}(); ${func}();
  1894. #endif
  1895.  }
  1896. EOF
  1897. if eval $compile; then
  1898.   {
  1899. test -n "$verbose" && \
  1900. echo '    defining' ${trfunc}
  1901. DEFS="$DEFS -D${trfunc}=1"
  1902. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1903. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1904. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1905. "
  1906. }
  1907.  
  1908. fi
  1909. rm -f conftest*
  1910. done
  1911.  
  1912.  
  1913. CFLAGS="$CFLAGS_save"
  1914. LIBS="$LIBS_save"
  1915.  
  1916. case "${window_system}:${LIBS}" in
  1917.   x11:*-lXbsd* )
  1918.     if [ -d /usr/X386/include ]; then
  1919.       HAVE_XFREE386=yes
  1920.       if [ "${C_SWITCH_X_SITE}" = "" ]; then
  1921.     C_SWITCH_X_SITE="-I/usr/X386/include"
  1922.       fi
  1923.     fi
  1924.   ;;
  1925. esac
  1926.  
  1927. #### Find out which version of Emacs this is.
  1928. version=`grep 'defconst[     ]*emacs-version' ${srcdir}/lisp/version.el \
  1929.      | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'`
  1930. if [ x"${version}" = x ]; then
  1931.   echo "${progname}: can't find current emacs version in
  1932.     \`${srcdir}/lisp/version.el'." >&2
  1933.   exit 1
  1934. fi
  1935.  
  1936.  
  1937. #### Specify what sort of things we'll be editing into Makefile and config.h.
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952. {
  1953. test -n "$verbose" && \
  1954. echo '    defining' config_machfile to be '"\"${machfile}\""'
  1955. DEFS="$DEFS -Dconfig_machfile="\"${machfile}\"""
  1956. SEDDEFS="${SEDDEFS}\${SEDdA}config_machfile\${SEDdB}config_machfile\${SEDdC}"\"${machfile}\""\${SEDdD}
  1957. \${SEDuA}config_machfile\${SEDuB}config_machfile\${SEDuC}"\"${machfile}\""\${SEDuD}
  1958. \${SEDeA}config_machfile\${SEDeB}config_machfile\${SEDeC}"\"${machfile}\""\${SEDeD}
  1959. "
  1960. }
  1961.  
  1962. {
  1963. test -n "$verbose" && \
  1964. echo '    defining' config_opsysfile to be '"\"${opsysfile}\""'
  1965. DEFS="$DEFS -Dconfig_opsysfile="\"${opsysfile}\"""
  1966. SEDDEFS="${SEDDEFS}\${SEDdA}config_opsysfile\${SEDdB}config_opsysfile\${SEDdC}"\"${opsysfile}\""\${SEDdD}
  1967. \${SEDuA}config_opsysfile\${SEDuB}config_opsysfile\${SEDuC}"\"${opsysfile}\""\${SEDuD}
  1968. \${SEDeA}config_opsysfile\${SEDeB}config_opsysfile\${SEDeC}"\"${opsysfile}\""\${SEDeD}
  1969. "
  1970. }
  1971.  
  1972. {
  1973. test -n "$verbose" && \
  1974. echo '    defining' LD_SWITCH_X_SITE to be '${LD_SWITCH_X_SITE}'
  1975. DEFS="$DEFS -DLD_SWITCH_X_SITE=${LD_SWITCH_X_SITE}"
  1976. SEDDEFS="${SEDDEFS}\${SEDdA}LD_SWITCH_X_SITE\${SEDdB}LD_SWITCH_X_SITE\${SEDdC}${LD_SWITCH_X_SITE}\${SEDdD}
  1977. \${SEDuA}LD_SWITCH_X_SITE\${SEDuB}LD_SWITCH_X_SITE\${SEDuC}${LD_SWITCH_X_SITE}\${SEDuD}
  1978. \${SEDeA}LD_SWITCH_X_SITE\${SEDeB}LD_SWITCH_X_SITE\${SEDeC}${LD_SWITCH_X_SITE}\${SEDeD}
  1979. "
  1980. }
  1981.  
  1982. {
  1983. test -n "$verbose" && \
  1984. echo '    defining' C_SWITCH_X_SITE to be '${C_SWITCH_X_SITE}'
  1985. DEFS="$DEFS -DC_SWITCH_X_SITE=${C_SWITCH_X_SITE}"
  1986. SEDDEFS="${SEDDEFS}\${SEDdA}C_SWITCH_X_SITE\${SEDdB}C_SWITCH_X_SITE\${SEDdC}${C_SWITCH_X_SITE}\${SEDdD}
  1987. \${SEDuA}C_SWITCH_X_SITE\${SEDuB}C_SWITCH_X_SITE\${SEDuC}${C_SWITCH_X_SITE}\${SEDuD}
  1988. \${SEDeA}C_SWITCH_X_SITE\${SEDeB}C_SWITCH_X_SITE\${SEDeC}${C_SWITCH_X_SITE}\${SEDeD}
  1989. "
  1990. }
  1991.  
  1992. {
  1993. test -n "$verbose" && \
  1994. echo '    defining' UNEXEC_SRC to be '${UNEXEC_SRC}'
  1995. DEFS="$DEFS -DUNEXEC_SRC=${UNEXEC_SRC}"
  1996. SEDDEFS="${SEDDEFS}\${SEDdA}UNEXEC_SRC\${SEDdB}UNEXEC_SRC\${SEDdC}${UNEXEC_SRC}\${SEDdD}
  1997. \${SEDuA}UNEXEC_SRC\${SEDuB}UNEXEC_SRC\${SEDuC}${UNEXEC_SRC}\${SEDuD}
  1998. \${SEDeA}UNEXEC_SRC\${SEDeB}UNEXEC_SRC\${SEDeC}${UNEXEC_SRC}\${SEDeD}
  1999. "
  2000. }
  2001.  
  2002.  
  2003.  
  2004. if [ "${HAVE_X_WINDOWS}" = "yes" ] ; then
  2005.    {
  2006. test -n "$verbose" && \
  2007. echo '    defining' HAVE_X_WINDOWS
  2008. DEFS="$DEFS -DHAVE_X_WINDOWS=1"
  2009. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_X_WINDOWS\${SEDdB}HAVE_X_WINDOWS\${SEDdC}1\${SEDdD}
  2010. \${SEDuA}HAVE_X_WINDOWS\${SEDuB}HAVE_X_WINDOWS\${SEDuC}1\${SEDuD}
  2011. \${SEDeA}HAVE_X_WINDOWS\${SEDeB}HAVE_X_WINDOWS\${SEDeC}1\${SEDeD}
  2012. "
  2013. }
  2014.  
  2015. fi
  2016. if [ "${HAVE_X11}" = "yes" ] ; then
  2017.    {
  2018. test -n "$verbose" && \
  2019. echo '    defining' HAVE_X11
  2020. DEFS="$DEFS -DHAVE_X11=1"
  2021. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_X11\${SEDdB}HAVE_X11\${SEDdC}1\${SEDdD}
  2022. \${SEDuA}HAVE_X11\${SEDuB}HAVE_X11\${SEDuC}1\${SEDuD}
  2023. \${SEDeA}HAVE_X11\${SEDeB}HAVE_X11\${SEDeC}1\${SEDeD}
  2024. "
  2025. }
  2026.  
  2027. fi
  2028. if [ "${HAVE_XFREE386}" = "yes" ] ; then
  2029.    {
  2030. test -n "$verbose" && \
  2031. echo '    defining' HAVE_XFREE386
  2032. DEFS="$DEFS -DHAVE_XFREE386=1"
  2033. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_XFREE386\${SEDdB}HAVE_XFREE386\${SEDdC}1\${SEDdD}
  2034. \${SEDuA}HAVE_XFREE386\${SEDuB}HAVE_XFREE386\${SEDuC}1\${SEDuD}
  2035. \${SEDeA}HAVE_XFREE386\${SEDeB}HAVE_XFREE386\${SEDeC}1\${SEDeD}
  2036. "
  2037. }
  2038.  
  2039. fi
  2040. if [ "${HAVE_X_MENU}" = "yes" ] ; then
  2041.    {
  2042. test -n "$verbose" && \
  2043. echo '    defining' HAVE_X_MENU
  2044. DEFS="$DEFS -DHAVE_X_MENU=1"
  2045. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_X_MENU\${SEDdB}HAVE_X_MENU\${SEDdC}1\${SEDdD}
  2046. \${SEDuA}HAVE_X_MENU\${SEDuB}HAVE_X_MENU\${SEDuC}1\${SEDuD}
  2047. \${SEDeA}HAVE_X_MENU\${SEDeB}HAVE_X_MENU\${SEDeC}1\${SEDeD}
  2048. "
  2049. }
  2050.  
  2051. fi
  2052. if [ "${GNU_MALLOC}" = "yes" ] ; then
  2053.    {
  2054. test -n "$verbose" && \
  2055. echo '    defining' GNU_MALLOC
  2056. DEFS="$DEFS -DGNU_MALLOC=1"
  2057. SEDDEFS="${SEDDEFS}\${SEDdA}GNU_MALLOC\${SEDdB}GNU_MALLOC\${SEDdC}1\${SEDdD}
  2058. \${SEDuA}GNU_MALLOC\${SEDuB}GNU_MALLOC\${SEDuC}1\${SEDuD}
  2059. \${SEDeA}GNU_MALLOC\${SEDeB}GNU_MALLOC\${SEDeC}1\${SEDeD}
  2060. "
  2061. }
  2062.  
  2063. fi
  2064. if [ "${REL_ALLOC}" = "yes" ] ; then
  2065.    {
  2066. test -n "$verbose" && \
  2067. echo '    defining' REL_ALLOC
  2068. DEFS="$DEFS -DREL_ALLOC=1"
  2069. SEDDEFS="${SEDDEFS}\${SEDdA}REL_ALLOC\${SEDdB}REL_ALLOC\${SEDdC}1\${SEDdD}
  2070. \${SEDuA}REL_ALLOC\${SEDuB}REL_ALLOC\${SEDuC}1\${SEDuD}
  2071. \${SEDeA}REL_ALLOC\${SEDeB}REL_ALLOC\${SEDeC}1\${SEDeD}
  2072. "
  2073. }
  2074.  
  2075. fi
  2076. if [ "${LISP_FLOAT_TYPE}" = "yes" ] ; then
  2077.    {
  2078. test -n "$verbose" && \
  2079. echo '    defining' LISP_FLOAT_TYPE
  2080. DEFS="$DEFS -DLISP_FLOAT_TYPE=1"
  2081. SEDDEFS="${SEDDEFS}\${SEDdA}LISP_FLOAT_TYPE\${SEDdB}LISP_FLOAT_TYPE\${SEDdC}1\${SEDdD}
  2082. \${SEDuA}LISP_FLOAT_TYPE\${SEDuB}LISP_FLOAT_TYPE\${SEDuC}1\${SEDuD}
  2083. \${SEDeA}LISP_FLOAT_TYPE\${SEDeB}LISP_FLOAT_TYPE\${SEDeC}1\${SEDeD}
  2084. "
  2085. }
  2086.  
  2087. fi
  2088.  
  2089.  
  2090. #### Report on what we decided to do.
  2091. echo "
  2092.  
  2093. Configured for \`${configuration}'.
  2094.  
  2095.   Where should the build process find the source code?    ${srcdir}
  2096.   What operating system and machine description files should Emacs use?
  2097.         \`${opsysfile}' and \`${machfile}'
  2098.   What compiler should emacs be built with?               ${CC} ${CFLAGS}
  2099.   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
  2100.   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
  2101.   What window system should Emacs use?                    ${window_system}${x_includes+
  2102.   Where do we find X Windows header files?                }${x_includes}${x_libraries+
  2103.   Where do we find X Windows libraries?                   }${x_libraries}
  2104.  
  2105. "
  2106.  
  2107. if test -n "$prefix"; then
  2108.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  2109.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  2110. fi
  2111. if test -n "$exec_prefix"; then
  2112.   prsub="$prsub
  2113. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  2114. fi
  2115. cat >conftest.def <<EOF
  2116. $DEFS
  2117. EOF
  2118. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  2119. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  2120. rm -f conftest.def
  2121.  
  2122. trap 'rm -f config.status; exit 1' 1 3 15
  2123. echo creating config.status
  2124. rm -f config.status
  2125. cat > config.status <<EOF
  2126. #!/bin/sh
  2127. # Generated automatically by configure.
  2128. # Run this file to recreate the current configuration.
  2129. # This directory was configured as follows,
  2130. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2131. #
  2132. # $0 $configure_args
  2133.  
  2134. for arg
  2135. do
  2136.   case "\$arg" in
  2137.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  2138.     exec /bin/sh $0 $configure_args ;;
  2139.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  2140.   esac
  2141. done
  2142.  
  2143. trap 'rm -f Makefile src/config.h conftest*; exit 1' 1 3 15
  2144. CC='$CC'
  2145. LN_S='$LN_S'
  2146. CPP='$CPP'
  2147. INSTALL='$INSTALL'
  2148. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  2149. INSTALL_DATA='$INSTALL_DATA'
  2150. YACC='$YACC'
  2151. ALLOCA='$ALLOCA'
  2152. configuration='$configuration'
  2153. version='$version'
  2154. srcdir='$srcdir'
  2155. c_switch_system='$c_switch_system'
  2156. libsrc_libs='$libsrc_libs'
  2157. rip_paths='$rip_paths'
  2158. inst_paths='$inst_paths'
  2159. LD_SWITCH_X_SITE='$LD_SWITCH_X_SITE'
  2160. C_SWITCH_X_SITE='$C_SWITCH_X_SITE'
  2161. CFLAGS='$CFLAGS'
  2162. prefix='$prefix'
  2163. exec_prefix='$exec_prefix'
  2164. LIBS='$LIBS'
  2165. prefix='$prefix'
  2166. exec_prefix='$exec_prefix'
  2167. prsub='$prsub'
  2168. EOF
  2169. cat >> config.status <<\EOF
  2170.  
  2171. top_srcdir=$srcdir
  2172.  
  2173. # Allow make-time overrides of the generated file list.
  2174. test -n "$gen_files" || gen_files="Makefile"
  2175.  
  2176. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  2177.   srcdir=$top_srcdir
  2178.   # Remove last slash and all that follows it.  Not all systems have dirname.
  2179.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  2180.   if test "$dir" != "$file"; then
  2181.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  2182.     test ! -d $dir && mkdir $dir
  2183.   fi
  2184.   echo creating $file
  2185.   rm -f $file
  2186.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  2187.   sed -e "
  2188. $prsub
  2189. s%@CC@%$CC%g
  2190. s%@LN_S@%$LN_S%g
  2191. s%@CPP@%$CPP%g
  2192. s%@INSTALL@%$INSTALL%g
  2193. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  2194. s%@INSTALL_DATA@%$INSTALL_DATA%g
  2195. s%@YACC@%$YACC%g
  2196. s%@ALLOCA@%$ALLOCA%g
  2197. s%@configuration@%$configuration%g
  2198. s%@version@%$version%g
  2199. s%@srcdir@%$srcdir%g
  2200. s%@c_switch_system@%$c_switch_system%g
  2201. s%@libsrc_libs@%$libsrc_libs%g
  2202. s%@rip_paths@%$rip_paths%g
  2203. s%@inst_paths@%$inst_paths%g
  2204. s%@LD_SWITCH_X_SITE@%$LD_SWITCH_X_SITE%g
  2205. s%@C_SWITCH_X_SITE@%$C_SWITCH_X_SITE%g
  2206. s%@CFLAGS@%$CFLAGS%g
  2207. s%@prefix@%$prefix%g
  2208. s%@exec_prefix@%$exec_prefix%g
  2209. s%@LIBS@%$LIBS%g
  2210. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  2211. fi; done
  2212. test -n "$gen_config" || gen_config=src/config.h
  2213. echo creating $gen_config
  2214. # These sed commands are put into SEDDEFS when defining a macro.
  2215. # They are broken into pieces to make the sed script easier to manage.
  2216. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  2217. # is the cpp macro being defined and VALUE is the value it is being given.
  2218. # Each defining turns into a single global substitution command.
  2219. #
  2220. # SEDd sets the value in "#define NAME VALUE" lines.
  2221. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  2222. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  2223. SEDdC='\3'
  2224. SEDdD='@g'
  2225. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  2226. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2227. SEDuB='\([     ]\)@\1#\2define\3'
  2228. SEDuC=' '
  2229. SEDuD='\4@g'
  2230. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  2231. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2232. SEDeB='$@\1#\2define\3'
  2233. SEDeC=' '
  2234. SEDeD='@g'
  2235. rm -f conftest.sed
  2236. EOF
  2237. # Turn off quoting long enough to insert the sed commands.
  2238. rm -f conftest.sh
  2239. cat > conftest.sh <<EOF
  2240. $SEDDEFS
  2241. EOF
  2242.  
  2243. # Maximum number of lines to put in a single here document.
  2244. maxshlines=9
  2245.  
  2246. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  2247. # on the size of here documents.
  2248.  
  2249. while :
  2250. do
  2251.   lines=`grep -c . conftest.sh`
  2252.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2253.   rm -f conftest.s1 conftest.s2
  2254.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  2255.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  2256.   # Write a limited-size here document to append to conftest.sed.
  2257.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  2258.   cat conftest.s1 >> config.status
  2259.   echo 'CONFEOF' >> config.status
  2260.   rm -f conftest.s1 conftest.sh
  2261.   mv conftest.s2 conftest.sh
  2262. done
  2263. rm -f conftest.sh
  2264.  
  2265. # Now back to your regularly scheduled config.status.
  2266. cat >> config.status <<\EOF
  2267. # This sed command replaces #undef's with comments.  This is necessary, for
  2268. # example, in the case of _POSIX_SOURCE, which is predefined and required
  2269. # on some systems where configure will not decide to define it in
  2270. # src/config.h.
  2271. cat >> conftest.sed <<\CONFEOF
  2272. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  2273. CONFEOF
  2274. rm -f conftest.h
  2275. # Break up the sed commands because old seds have small limits.
  2276. maxsedlines=20
  2277. cp $top_srcdir/$gen_config.in conftest.h1
  2278. while :
  2279. do
  2280.   lines=`grep -c . conftest.sed`
  2281.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2282.   rm -f conftest.s1 conftest.s2 conftest.h2
  2283.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  2284.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  2285.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  2286.   rm -f conftest.s1 conftest.h1 conftest.sed
  2287.   mv conftest.h2 conftest.h1
  2288.   mv conftest.s2 conftest.sed
  2289. done
  2290. rm -f conftest.sed conftest.h
  2291. echo "/* $gen_config.  Generated automatically by configure.  */" > conftest.h
  2292. cat conftest.h1 >> conftest.h
  2293. rm -f conftest.h1
  2294. if cmp -s $gen_config conftest.h 2>/dev/null; then
  2295.   # The file exists and we would not be changing it.
  2296.   rm -f conftest.h
  2297. else
  2298.   rm -f $gen_config
  2299.   mv conftest.h $gen_config
  2300. fi
  2301.  
  2302.  
  2303. exit 0
  2304. EOF
  2305. chmod +x config.status
  2306. test -n "$no_create" || ./config.status
  2307.  
  2308.